From 250bc3b51f70f8fb62591a00a615f66f7e0f6ec0 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Mon, 21 Jun 2004 06:43:35 +0000 Subject: [PATCH] bitkeeper revision 1.990 (40d68397bwq-y7FYqVQDBuzsbxWyNA) Only pause a domain in getdomainfo if we're reading execution context. --- xen/common/dom0_ops.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/xen/common/dom0_ops.c b/xen/common/dom0_ops.c index 515ff4d2b8..7af451bfe5 100644 --- a/xen/common/dom0_ops.c +++ b/xen/common/dom0_ops.c @@ -295,21 +295,16 @@ long do_dom0_op(dom0_op_t *u_dom0_op) read_unlock_irqrestore(&tasklist_lock, flags); - op->u.getdomaininfo.flags = - (test_bit(DF_RUNNING, &d->flags) ? DOMFLAGS_RUNNING : 0); - - if ( d != current ) - domain_pause(d); - op->u.getdomaininfo.domain = d->domain; strcpy(op->u.getdomaininfo.name, d->name); - op->u.getdomaininfo.flags |= + op->u.getdomaininfo.flags = (test_bit(DF_DYING, &d->flags) ? DOMFLAGS_DYING : 0) | (test_bit(DF_CRASHED, &d->flags) ? DOMFLAGS_CRASHED : 0) | (test_bit(DF_SUSPENDED, &d->flags) ? DOMFLAGS_SUSPENDED : 0) | (test_bit(DF_STOPPED, &d->flags) ? DOMFLAGS_STOPPED : 0) | - (test_bit(DF_BLOCKED, &d->flags) ? DOMFLAGS_BLOCKED : 0); + (test_bit(DF_BLOCKED, &d->flags) ? DOMFLAGS_BLOCKED : 0) | + (test_bit(DF_RUNNING, &d->flags) ? DOMFLAGS_RUNNING : 0); op->u.getdomaininfo.flags |= d->processor << DOMFLAGS_CPUSHIFT; op->u.getdomaininfo.flags |= @@ -326,9 +321,13 @@ long do_dom0_op(dom0_op_t *u_dom0_op) if ( (c = kmalloc(sizeof(*c), GFP_KERNEL)) == NULL ) { ret = -ENOMEM; - goto gdi_out; + put_domain(d); + break; } + if ( d != current ) + domain_pause(d); + c->flags = 0; memcpy(&c->cpu_ctxt, &d->shared_info->execution_context, @@ -376,6 +375,9 @@ long do_dom0_op(dom0_op_t *u_dom0_op) c->failsafe_callback_eip = d->failsafe_address; + if ( d != current ) + domain_unpause(d); + if ( copy_to_user(op->u.getdomaininfo.ctxt, c, sizeof(*c)) ) ret = -EINVAL; @@ -386,9 +388,6 @@ long do_dom0_op(dom0_op_t *u_dom0_op) if ( copy_to_user(u_dom0_op, op, sizeof(*op)) ) ret = -EINVAL; - gdi_out: - if ( d != current ) - domain_unpause(d); put_domain(d); } break; -- 2.30.2